.TH std::set_unexpected 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::set_unexpected \- std::set_unexpected

.SH Synopsis
   Defined in header <exception>
   std::unexpected_handler set_unexpected( std::unexpected_handler   \fI(until C++11)\fP
   f ) throw();
   std::unexpected_handler set_unexpected( std::unexpected_handler   \fI(since C++11)\fP
   f ) noexcept;                                                     \fB(deprecated)\fP
                                                                     (removed in C++17)

   Makes f the new global std::unexpected_handler and returns the previously installed
   std::unexpected_handler.

   This function is thread-safe. Every call to std::set_unexpected
   synchronizes-with (see std::memory_order) the subsequent calls to      \fI(since C++11)\fP
   std::set_unexpected and std::get_unexpected

.SH Parameters

   f - pointer to function of type std::unexpected_handler, or null pointer

.SH Return value

   The previously-installed unexpected handler, or a null pointer value if none was
   installed.

.SH See also

   unexpected                function called when dynamic exception specification is
   (removed in C++17)        violated
                             \fI(function)\fP
   get_unexpected            obtains the current unexpected_handler
   \fI(C++11)\fP(removed in C++17) \fI(function)\fP
   unexpected_handler        the type of the function called by std::unexpected
   (removed in C++17)        \fI(typedef)\fP
